package com.ruoyi.common.filter;

import org.springframework.core.NamedThreadLocal;

import javax.servlet.*;
import java.io.IOException;

public class PageHandlerFilter implements Filter {

    public static final ThreadLocal<Long> TOTAL_THREADLOCAL = new NamedThreadLocal<Long>("Page Total");

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
            throws IOException, ServletException
    {
        chain.doFilter(request, response);
        TOTAL_THREADLOCAL.remove();
    }

}
